namespace InventoryManagement
{
	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.Data;
	using System.Data.SqlClient;
	using System.Text;
	
	
	public class Inventory_VM : BaseTable
	{
		
		#region Static SQL String Members
		/// <remarks>This field represents the full SELECT string for the table Inventory VM, with the WHERE clause.</remarks>
		internal static string _SQL_Select = @"SELECT [ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [ID_LabelName], [Date], [SystemClass], [StartFrom], [SystemDetail], [Host_Name], [Host_IP], [ID_DataCabang], [ID_OperatingSystem], [Guest_Application], [Guest_Processor], [Guest_Disk], [Guest_Memory], [Guest_Notes], [Guest_DiskCapacity], [URLAttachment], [IsDeleted] FROM [dbo].[Inventory VM] WHERE [ID]=@ID ";
		
		/// <remarks>This field represents the full SELECT string for the table Inventory VM, with the WHERE clause.</remarks>
		internal static string _SQL_SelectByParam = "SELECT [ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [ID_LabelName], [Date], [SystemClass], [StartFrom], [SystemDetail], [Host_Name], [Host_IP], [ID_DataCabang], [ID_OperatingSystem], [Guest_Application], [Guest_Processor], [Guest_Disk], [Guest_Memory], [Guest_Notes], [Guest_DiskCapacity], [URLAttachment], [IsDeleted] FROM [dbo].[Inventory VM] WHERE isnull(convert(varchar(36),[ID]),\'true\')=isnull(convert(varchar(36),@ID),isnull(convert(varchar(36),[ID]),\'true\')) AND isnull(convert(varchar(36),[ID_SysBrand]),\'true\')=isnull(convert(varchar(36),@ID_SysBrand),isnull(convert(varchar(36),[ID_SysBrand]),\'true\')) AND isnull(convert(varchar(36),[ID_SysType]),\'true\')=isnull(convert(varchar(36),@ID_SysType),isnull(convert(varchar(36),[ID_SysType]),\'true\')) AND isnull(convert(varchar,[InventoryBy]),\'true\')=isnull(convert(varchar,@InventoryBy),isnull(convert(varchar,[InventoryBy]),\'true\')) AND isnull(convert(varchar,[InventoryDate]),\'true\')=isnull(convert(varchar,@InventoryDate),isnull(convert(varchar,[InventoryDate]),\'true\')) AND isnull(convert(varchar(36),[ID_RackNumber]),\'true\')=isnull(convert(varchar(36),@ID_RackNumber),isnull(convert(varchar(36),[ID_RackNumber]),\'true\')) AND isnull(convert(varchar(36),[ID_LabelName]),\'true\')=isnull(convert(varchar(36),@ID_LabelName),isnull(convert(varchar(36),[ID_LabelName]),\'true\')) AND isnull(convert(varchar,[Date]),\'true\')=isnull(convert(varchar,@Date),isnull(convert(varchar,[Date]),\'true\')) AND isnull(convert(varchar,[SystemClass]),\'true\')=isnull(convert(varchar,@SystemClass),isnull(convert(varchar,[SystemClass]),\'true\')) AND isnull(convert(varchar,[StartFrom]),\'true\')=isnull(convert(varchar,@StartFrom),isnull(convert(varchar,[StartFrom]),\'true\')) AND isnull(convert(varchar,[SystemDetail]),\'true\')=isnull(convert(varchar,@SystemDetail),isnull(convert(varchar,[SystemDetail]),\'true\')) AND isnull(convert(varchar,[Host_Name]),\'true\')=isnull(convert(varchar,@Host_Name),isnull(convert(varchar,[Host_Name]),\'true\')) AND isnull(convert(varchar,[Host_IP]),\'true\')=isnull(convert(varchar,@Host_IP),isnull(convert(varchar,[Host_IP]),\'true\')) AND isnull(convert(varchar(36),[ID_DataCabang]),\'true\')=isnull(convert(varchar(36),@ID_DataCabang),isnull(convert(varchar(36),[ID_DataCabang]),\'true\')) AND isnull(convert(varchar(36),[ID_OperatingSystem]),\'true\')=isnull(convert(varchar(36),@ID_OperatingSystem),isnull(convert(varchar(36),[ID_OperatingSystem]),\'true\')) AND isnull(convert(varchar,[Guest_Application]),\'true\')=isnull(convert(varchar,@Guest_Application),isnull(convert(varchar,[Guest_Application]),\'true\')) AND isnull(convert(varchar,[Guest_Processor]),\'true\')=isnull(convert(varchar,@Guest_Processor),isnull(convert(varchar,[Guest_Processor]),\'true\')) AND isnull(convert(varchar,[Guest_Disk]),\'true\')=isnull(convert(varchar,@Guest_Disk),isnull(convert(varchar,[Guest_Disk]),\'true\')) AND isnull(convert(varchar,[Guest_Memory]),\'true\')=isnull(convert(varchar,@Guest_Memory),isnull(convert(varchar,[Guest_Memory]),\'true\')) AND isnull(convert(varchar,[Guest_Notes]),\'true\')=isnull(convert(varchar,@Guest_Notes),isnull(convert(varchar,[Guest_Notes]),\'true\')) AND isnull(convert(varchar,[Guest_DiskCapacity]),\'true\')=isnull(convert(varchar,@Guest_DiskCapacity),isnull(convert(varchar,[Guest_DiskCapacity]),\'true\')) AND isnull(convert(varchar,[URLAttachment]),\'true\')=isnull(convert(varchar,@URLAttachment),isnull(convert(varchar,[URLAttachment]),\'true\')) AND isnull(convert(varchar,[IsDeleted]),\'true\')=isnull(convert(varchar,@IsDeleted),isnull(convert(varchar,[IsDeleted]),\'true\')) ";
		
		/// <remarks>This field represents the full INSERT INTO string for the table Inventory VM.</remarks>
		internal static string _SQL_Insert = @"INSERT INTO [dbo].[Inventory VM] ([ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [ID_LabelName], [Date], [SystemClass], [StartFrom], [SystemDetail], [Host_Name], [Host_IP], [ID_DataCabang], [ID_OperatingSystem], [Guest_Application], [Guest_Processor], [Guest_Disk], [Guest_Memory], [Guest_Notes], [Guest_DiskCapacity], [URLAttachment], [IsDeleted]) VALUES(@ID, @ID_SysBrand, @ID_SysType, @InventoryBy, @InventoryDate, @ID_RackNumber, @ID_LabelName, @Date, @SystemClass, @StartFrom, @SystemDetail, @Host_Name, @Host_IP, @ID_DataCabang, @ID_OperatingSystem, @Guest_Application, @Guest_Processor, @Guest_Disk, @Guest_Memory, @Guest_Notes, @Guest_DiskCapacity, @URLAttachment, @IsDeleted) ";
		
		/// <remarks>This field represents the full UPDATE string for the table Inventory VM, with the WHERE clause.</remarks>
		internal static string _SQL_Update = @"UPDATE [dbo].[Inventory VM] SET [ID] = @ID, [ID_SysBrand] = @ID_SysBrand, [ID_SysType] = @ID_SysType, [InventoryBy] = @InventoryBy, [InventoryDate] = @InventoryDate, [ID_RackNumber] = @ID_RackNumber, [ID_LabelName] = @ID_LabelName, [Date] = @Date, [SystemClass] = @SystemClass, [StartFrom] = @StartFrom, [SystemDetail] = @SystemDetail, [Host_Name] = @Host_Name, [Host_IP] = @Host_IP, [ID_DataCabang] = @ID_DataCabang, [ID_OperatingSystem] = @ID_OperatingSystem, [Guest_Application] = @Guest_Application, [Guest_Processor] = @Guest_Processor, [Guest_Disk] = @Guest_Disk, [Guest_Memory] = @Guest_Memory, [Guest_Notes] = @Guest_Notes, [Guest_DiskCapacity] = @Guest_DiskCapacity, [URLAttachment] = @URLAttachment, [IsDeleted] = @IsDeleted WHERE [ID]=@ID ";
		
		/// <remarks>This field represents the DELETE string for the table Inventory VM, with the WHERE clause.</remarks>
		internal static string _SQL_Delete = "DELETE FROM [dbo].[Inventory VM] WHERE [ID]=@ID ";
		#endregion
		
		#region Tables Members
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID;
		
		[DisplayName("ID")]
		[Category("Primary Key")]
		public System.Nullable<System.Guid> ID
		{
			get
			{
				try
				{
					return _ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID", err);
				}
			}
			set
			{
				try
				{
					_ID = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_SysBrand;
		
		[DisplayName("ID_Sys Brand")]
		[Category("Foreign Key")]
		public System.Nullable<System.Guid> ID_SysBrand
		{
			get
			{
				try
				{
					return _ID_SysBrand;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_SysBrand", err);
				}
			}
			set
			{
				try
				{
					_ID_SysBrand = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_SysBrand", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_SysType;
		
		[DisplayName("ID_Sys Type")]
		[Category("Foreign Key")]
		public System.Nullable<System.Guid> ID_SysType
		{
			get
			{
				try
				{
					return _ID_SysType;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_SysType", err);
				}
			}
			set
			{
				try
				{
					_ID_SysType = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_SysType", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _InventoryBy;
		
		[DisplayName("Inventory By")]
		[Category("Column")]
		public string InventoryBy
		{
			get
			{
				try
				{
					return _InventoryBy;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting InventoryBy", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_InventoryBy = value;
					}
					else
					{
						throw new OverflowException("Error setting InventoryBy, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting InventoryBy", err);
				}
			}
		}
		
		/// <remarks>SQL Type:datetime - </remarks>
		private System.Nullable<System.DateTime> _InventoryDate;
		
		[DisplayName("Inventory Date")]
		[Category("Column")]
		public System.Nullable<System.DateTime> InventoryDate
		{
			get
			{
				try
				{
					return _InventoryDate;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting InventoryDate", err);
				}
			}
			set
			{
				try
				{
					_InventoryDate = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting InventoryDate", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_RackNumber;
		
		[DisplayName("ID_Rack Number")]
		[Category("Column")]
		public System.Nullable<System.Guid> ID_RackNumber
		{
			get
			{
				try
				{
					return _ID_RackNumber;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_RackNumber", err);
				}
			}
			set
			{
				try
				{
					_ID_RackNumber = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_RackNumber", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_LabelName;
		
		[DisplayName("ID_Label Name")]
		[Category("Column")]
		public System.Nullable<System.Guid> ID_LabelName
		{
			get
			{
				try
				{
					return _ID_LabelName;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_LabelName", err);
				}
			}
			set
			{
				try
				{
					_ID_LabelName = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_LabelName", err);
				}
			}
		}
		
		/// <remarks>SQL Type:datetime - </remarks>
		private System.Nullable<System.DateTime> _Date;
		
		[DisplayName("Date")]
		[Category("Column")]
		public System.Nullable<System.DateTime> Date
		{
			get
			{
				try
				{
					return _Date;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Date", err);
				}
			}
			set
			{
				try
				{
					_Date = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Date", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _SystemClass;
		
		[DisplayName("System Class")]
		[Category("Column")]
		public string SystemClass
		{
			get
			{
				try
				{
					return _SystemClass;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting SystemClass", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_SystemClass = value;
					}
					else
					{
						throw new OverflowException("Error setting SystemClass, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting SystemClass", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _StartFrom;
		
		[DisplayName("Start From")]
		[Category("Column")]
		public string StartFrom
		{
			get
			{
				try
				{
					return _StartFrom;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting StartFrom", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_StartFrom = value;
					}
					else
					{
						throw new OverflowException("Error setting StartFrom, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting StartFrom", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _SystemDetail;
		
		[DisplayName("System Detail")]
		[Category("Column")]
		public string SystemDetail
		{
			get
			{
				try
				{
					return _SystemDetail;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting SystemDetail", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_SystemDetail = value;
					}
					else
					{
						throw new OverflowException("Error setting SystemDetail, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting SystemDetail", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Host_Name;
		
		[DisplayName("Host_Name")]
		[Category("Column")]
		public string Host_Name
		{
			get
			{
				try
				{
					return _Host_Name;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Host_Name", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_Host_Name = value;
					}
					else
					{
						throw new OverflowException("Error setting Host_Name, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Host_Name", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Host_IP;
		
		[DisplayName("Host_IP")]
		[Category("Column")]
		public string Host_IP
		{
			get
			{
				try
				{
					return _Host_IP;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Host_IP", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_Host_IP = value;
					}
					else
					{
						throw new OverflowException("Error setting Host_IP, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Host_IP", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_DataCabang;
		
		[DisplayName("ID_Data Cabang")]
		[Category("Foreign Key")]
		public System.Nullable<System.Guid> ID_DataCabang
		{
			get
			{
				try
				{
					return _ID_DataCabang;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_DataCabang", err);
				}
			}
			set
			{
				try
				{
					_ID_DataCabang = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_DataCabang", err);
				}
			}
		}
		
		/// <remarks>SQL Type:uniqueidentifier - </remarks>
		private System.Nullable<System.Guid> _ID_OperatingSystem;
		
		[DisplayName("ID_Operating System")]
		[Category("Foreign Key")]
		public System.Nullable<System.Guid> ID_OperatingSystem
		{
			get
			{
				try
				{
					return _ID_OperatingSystem;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_OperatingSystem", err);
				}
			}
			set
			{
				try
				{
					_ID_OperatingSystem = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_OperatingSystem", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Guest_Application;
		
		[DisplayName("Guest_Application")]
		[Category("Column")]
		public string Guest_Application
		{
			get
			{
				try
				{
					return _Guest_Application;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Guest_Application", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 200))
					{
						_Guest_Application = value;
					}
					else
					{
						throw new OverflowException("Error setting Guest_Application, Length of value is to long. Maximum Length: 200");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Guest_Application", err);
				}
			}
		}
		
		/// <remarks>SQL Type:int - </remarks>
		private System.Nullable<int> _Guest_Processor;
		
		[DisplayName("Guest_Processor")]
		[Category("Column")]
		public System.Nullable<int> Guest_Processor
		{
			get
			{
				try
				{
					return _Guest_Processor;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Guest_Processor", err);
				}
			}
			set
			{
				try
				{
					_Guest_Processor = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Guest_Processor", err);
				}
			}
		}
		
		/// <remarks>SQL Type:int - </remarks>
		private System.Nullable<int> _Guest_Disk;
		
		[DisplayName("Guest_Disk")]
		[Category("Column")]
		public System.Nullable<int> Guest_Disk
		{
			get
			{
				try
				{
					return _Guest_Disk;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Guest_Disk", err);
				}
			}
			set
			{
				try
				{
					_Guest_Disk = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Guest_Disk", err);
				}
			}
		}
		
		/// <remarks>SQL Type:int - </remarks>
		private System.Nullable<int> _Guest_Memory;
		
		[DisplayName("Guest_Memory")]
		[Category("Column")]
		public System.Nullable<int> Guest_Memory
		{
			get
			{
				try
				{
					return _Guest_Memory;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Guest_Memory", err);
				}
			}
			set
			{
				try
				{
					_Guest_Memory = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Guest_Memory", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _Guest_Notes;
		
		[DisplayName("Guest_Notes")]
		[Category("Column")]
		public string Guest_Notes
		{
			get
			{
				try
				{
					return _Guest_Notes;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Guest_Notes", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 1000))
					{
						_Guest_Notes = value;
					}
					else
					{
						throw new OverflowException("Error setting Guest_Notes, Length of value is to long. Maximum Length: 1000");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Guest_Notes", err);
				}
			}
		}
		
		/// <remarks>SQL Type:int - </remarks>
		private System.Nullable<int> _Guest_DiskCapacity;
		
		[DisplayName("Guest_Disk Capacity")]
		[Category("Column")]
		public System.Nullable<int> Guest_DiskCapacity
		{
			get
			{
				try
				{
					return _Guest_DiskCapacity;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting Guest_DiskCapacity", err);
				}
			}
			set
			{
				try
				{
					_Guest_DiskCapacity = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting Guest_DiskCapacity", err);
				}
			}
		}
		
		/// <remarks>SQL Type:varchar - </remarks>
		private string _URLAttachment;
		
		[DisplayName("URLAttachment")]
		[Category("Column")]
		public string URLAttachment
		{
			get
			{
				try
				{
					return _URLAttachment;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting URLAttachment", err);
				}
			}
			set
			{
				try
				{
					if ((value.Length <= 400))
					{
						_URLAttachment = value;
					}
					else
					{
						throw new OverflowException("Error setting URLAttachment, Length of value is to long. Maximum Length: 400");
					}
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting URLAttachment", err);
				}
			}
		}
		
		/// <remarks>SQL Type:bit - </remarks>
		private System.Nullable<bool> _IsDeleted;
		
		[DisplayName("Is Deleted")]
		[Category("Column")]
		public System.Nullable<bool> IsDeleted
		{
			get
			{
				try
				{
					return _IsDeleted;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting IsDeleted", err);
				}
			}
			set
			{
				try
				{
					_IsDeleted = value;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting IsDeleted", err);
				}
			}
		}
		#endregion
		
		#region Related Objects
		/// <remarks>Represents the foreign key object</remarks>
		private Location _ID_DataCabang_Location;
		
		[Description("Represents the foreign key object of the type Location")]
		public Location ID_DataCabang_Location
		{
			get
			{
				try
				{
					return _ID_DataCabang_Location;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_DataCabang_Location", err);
				}
			}
			set
			{
				try
				{
					_ID_DataCabang_Location = value;
					_ID_DataCabang = _ID_DataCabang_Location.ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_DataCabang_Location", err);
				}
			}
		}
		
		/// <remarks>Represents the foreign key object</remarks>
		private Operating_System _ID_OperatingSystem_Operating_System;
		
		[Description("Represents the foreign key object of the type Operating_System")]
		public Operating_System ID_OperatingSystem_Operating_System
		{
			get
			{
				try
				{
					return _ID_OperatingSystem_Operating_System;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_OperatingSystem_Operating_System", err);
				}
			}
			set
			{
				try
				{
					_ID_OperatingSystem_Operating_System = value;
					_ID_OperatingSystem = _ID_OperatingSystem_Operating_System.ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_OperatingSystem_Operating_System", err);
				}
			}
		}
		
		/// <remarks>Represents the foreign key object</remarks>
		private System_Brand _ID_SysBrand_System_Brand;
		
		[Description("Represents the foreign key object of the type System_Brand")]
		public System_Brand ID_SysBrand_System_Brand
		{
			get
			{
				try
				{
					return _ID_SysBrand_System_Brand;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_SysBrand_System_Brand", err);
				}
			}
			set
			{
				try
				{
					_ID_SysBrand_System_Brand = value;
					_ID_SysBrand = _ID_SysBrand_System_Brand.ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_SysBrand_System_Brand", err);
				}
			}
		}
		
		/// <remarks>Represents the foreign key object</remarks>
		private System_Type _ID_SysType_System_Type;
		
		[Description("Represents the foreign key object of the type System_Type")]
		public System_Type ID_SysType_System_Type
		{
			get
			{
				try
				{
					return _ID_SysType_System_Type;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error getting ID_SysType_System_Type", err);
				}
			}
			set
			{
				try
				{
					_ID_SysType_System_Type = value;
					_ID_SysType = _ID_SysType_System_Type.ID;
				}
				catch (System.Exception err)
				{
					throw new Exception("Error setting ID_SysType_System_Type", err);
				}
			}
		}
		#endregion
		
		#region Public Methods
		public void Select()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_VM._SQL_Select;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				SqlDataReader rs = Com.ExecuteReader();
				while(rs.Read())
				{
					AddFromRecordSet(rs);
				}
				rs.Close();
				Conn.Close();
				rs.Dispose();
				Com.Dispose();
				Conn.Dispose();
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public System.Data.DataTable SelectByParam()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_VM._SQL_SelectByParam;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				SqlDataAdapter objDataAdapter = new SqlDataAdapter(Com);
				DataTable objDataTable = new DataTable();
				objDataAdapter.Fill(objDataTable);
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return objDataTable;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Insert()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_VM._SQL_Insert;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Update()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_VM._SQL_Update;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public int Delete()
		{
			try
			{
				SqlConnection Conn = new SqlConnection(_connString);
				SqlCommand Com = Conn.CreateCommand();
				Com.CommandText = Inventory_VM._SQL_Delete;
				Com.Parameters.AddRange(GetSqlParameters());
				Conn.Open();
				int rowseffected = Com.ExecuteNonQuery();
				Conn.Close();
				Com.Dispose();
				Conn.Dispose();
				return rowseffected;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		
		public string[] GetSqlCommandStrings()
		{
			try
			{
				string[] CommStr = new string[4];
				CommStr[0] = "SELECT [ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [ID_LabelName], [Date], [SystemClass], [StartFrom], [SystemDetail], [Host_Name], [Host_IP], [ID_DataCabang], [ID_OperatingSystem], [Guest_Application], [Guest_Processor], [Guest_Disk], [Guest_Memory], [Guest_Notes], [Guest_DiskCapacity], [URLAttachment], [IsDeleted] FROM [dbo].[Inventory VM] WHERE [ID] = " + _ID + "";
				CommStr[1] = "INSERT INTO [dbo].[Inventory VM] ([ID], [ID_SysBrand], [ID_SysType], [InventoryBy], [InventoryDate], [ID_RackNumber], [ID_LabelName], [Date], [SystemClass], [StartFrom], [SystemDetail], [Host_Name], [Host_IP], [ID_DataCabang], [ID_OperatingSystem], [Guest_Application], [Guest_Processor], [Guest_Disk], [Guest_Memory], [Guest_Notes], [Guest_DiskCapacity], [URLAttachment], [IsDeleted]) VALUES(" + _ID + ", " + _ID_SysBrand + ", " + _ID_SysType + ", '" + _InventoryBy.Replace("'","''") + "', '" + _InventoryDate + "', " + _ID_RackNumber + ", " + _ID_LabelName + ", '" + _Date + "', '" + _SystemClass.Replace("'","''") + "', '" + _StartFrom.Replace("'","''") + "', '" + _SystemDetail.Replace("'","''") + "', '" + _Host_Name.Replace("'","''") + "', '" + _Host_IP.Replace("'","''") + "', " + _ID_DataCabang + ", " + _ID_OperatingSystem + ", '" + _Guest_Application.Replace("'","''") + "', " + _Guest_Processor + ", " + _Guest_Disk + ", " + _Guest_Memory + ", '" + _Guest_Notes.Replace("'","''") + "', " + _Guest_DiskCapacity + ", '" + _URLAttachment.Replace("'","''") + "', " + _IsDeleted + ")";
				CommStr[2] = "UPDATE [dbo].[Inventory VM] SET [ID_SysBrand] = " + _ID_SysBrand + " ,[ID_SysType] = " + _ID_SysType + " ,[InventoryBy] = '" + _InventoryBy.Replace("'","''") + "' ,[InventoryDate] = '" + _InventoryDate + "' ,[ID_RackNumber] = " + _ID_RackNumber + " ,[ID_LabelName] = " + _ID_LabelName + " ,[Date] = '" + _Date + "' ,[SystemClass] = '" + _SystemClass.Replace("'","''") + "' ,[StartFrom] = '" + _StartFrom.Replace("'","''") + "' ,[SystemDetail] = '" + _SystemDetail.Replace("'","''") + "' ,[Host_Name] = '" + _Host_Name.Replace("'","''") + "' ,[Host_IP] = '" + _Host_IP.Replace("'","''") + "' ,[ID_DataCabang] = " + _ID_DataCabang + " ,[ID_OperatingSystem] = " + _ID_OperatingSystem + " ,[Guest_Application] = '" + _Guest_Application.Replace("'","''") + "' ,[Guest_Processor] = " + _Guest_Processor + " ,[Guest_Disk] = " + _Guest_Disk + " ,[Guest_Memory] = " + _Guest_Memory + " ,[Guest_Notes] = '" + _Guest_Notes.Replace("'","''") + "' ,[Guest_DiskCapacity] = " + _Guest_DiskCapacity + " ,[URLAttachment] = '" + _URLAttachment.Replace("'","''") + "' ,[IsDeleted] = " + _IsDeleted + " WHERE [ID] = " + _ID + "";
				CommStr[3] = "DELETE FROM [dbo].[Inventory VM] WHERE [ID] = " + _ID + "";
				return CommStr;
			}
			catch (System.Exception )
			{
				throw;
			}
		}
		#endregion
		
		#region Private Methods
		private void AddFromRecordSet(SqlDataReader rs)
		{
			try
			{
				// if value from the recordset, to the ID field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID")) == false))
				{
					ID = rs.GetGuid(rs.GetOrdinal("ID"));
				}
				// if value from the recordset, to the ID_SysBrand field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_SysBrand")) == false))
				{
					ID_SysBrand = rs.GetGuid(rs.GetOrdinal("ID_SysBrand"));
				}
				// if value from the recordset, to the ID_SysType field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_SysType")) == false))
				{
					ID_SysType = rs.GetGuid(rs.GetOrdinal("ID_SysType"));
				}
				// if value from the recordset, to the InventoryBy field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("InventoryBy")) == false))
				{
					InventoryBy = rs.GetString(rs.GetOrdinal("InventoryBy"));
				}
				// if value from the recordset, to the InventoryDate field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("InventoryDate")) == false))
				{
					InventoryDate = rs.GetDateTime(rs.GetOrdinal("InventoryDate"));
				}
				// if value from the recordset, to the ID_RackNumber field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_RackNumber")) == false))
				{
					ID_RackNumber = rs.GetGuid(rs.GetOrdinal("ID_RackNumber"));
				}
				// if value from the recordset, to the ID_LabelName field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_LabelName")) == false))
				{
					ID_LabelName = rs.GetGuid(rs.GetOrdinal("ID_LabelName"));
				}
				// if value from the recordset, to the Date field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Date")) == false))
				{
					Date = rs.GetDateTime(rs.GetOrdinal("Date"));
				}
				// if value from the recordset, to the SystemClass field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("SystemClass")) == false))
				{
					SystemClass = rs.GetString(rs.GetOrdinal("SystemClass"));
				}
				// if value from the recordset, to the StartFrom field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("StartFrom")) == false))
				{
					StartFrom = rs.GetString(rs.GetOrdinal("StartFrom"));
				}
				// if value from the recordset, to the SystemDetail field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("SystemDetail")) == false))
				{
					SystemDetail = rs.GetString(rs.GetOrdinal("SystemDetail"));
				}
				// if value from the recordset, to the Host_Name field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Host_Name")) == false))
				{
					Host_Name = rs.GetString(rs.GetOrdinal("Host_Name"));
				}
				// if value from the recordset, to the Host_IP field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Host_IP")) == false))
				{
					Host_IP = rs.GetString(rs.GetOrdinal("Host_IP"));
				}
				// if value from the recordset, to the ID_DataCabang field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_DataCabang")) == false))
				{
					ID_DataCabang = rs.GetGuid(rs.GetOrdinal("ID_DataCabang"));
				}
				// if value from the recordset, to the ID_OperatingSystem field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("ID_OperatingSystem")) == false))
				{
					ID_OperatingSystem = rs.GetGuid(rs.GetOrdinal("ID_OperatingSystem"));
				}
				// if value from the recordset, to the Guest_Application field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Guest_Application")) == false))
				{
					Guest_Application = rs.GetString(rs.GetOrdinal("Guest_Application"));
				}
				// if value from the recordset, to the Guest_Processor field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Guest_Processor")) == false))
				{
					Guest_Processor = rs.GetInt32(rs.GetOrdinal("Guest_Processor"));
				}
				// if value from the recordset, to the Guest_Disk field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Guest_Disk")) == false))
				{
					Guest_Disk = rs.GetInt32(rs.GetOrdinal("Guest_Disk"));
				}
				// if value from the recordset, to the Guest_Memory field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Guest_Memory")) == false))
				{
					Guest_Memory = rs.GetInt32(rs.GetOrdinal("Guest_Memory"));
				}
				// if value from the recordset, to the Guest_Notes field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Guest_Notes")) == false))
				{
					Guest_Notes = rs.GetString(rs.GetOrdinal("Guest_Notes"));
				}
				// if value from the recordset, to the Guest_DiskCapacity field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("Guest_DiskCapacity")) == false))
				{
					Guest_DiskCapacity = rs.GetInt32(rs.GetOrdinal("Guest_DiskCapacity"));
				}
				// if value from the recordset, to the URLAttachment field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("URLAttachment")) == false))
				{
					URLAttachment = rs.GetString(rs.GetOrdinal("URLAttachment"));
				}
				// if value from the recordset, to the IsDeleted field is NOT null then set the value.
				if ((rs.IsDBNull(rs.GetOrdinal("IsDeleted")) == false))
				{
					IsDeleted = rs.GetBoolean(rs.GetOrdinal("IsDeleted"));
				}
			}
			catch (SqlException sqlExc)
			{
				throw sqlExc;
			}
			catch (Exception Exc)
			{
				throw Exc;
			}
		}
		
		private SqlParameter[] GetSqlParameters()
		{
			List<SqlParameter> SqlParmColl = new List<SqlParameter>();
			try
			{
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID", ID, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_SysBrand", ID_SysBrand, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_SysType", ID_SysType, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@InventoryBy", InventoryBy, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@InventoryDate", InventoryDate, SqlDbType.DateTime));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_RackNumber", ID_RackNumber, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_LabelName", ID_LabelName, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Date", Date, SqlDbType.DateTime));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@SystemClass", SystemClass, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@StartFrom", StartFrom, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@SystemDetail", SystemDetail, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Host_Name", Host_Name, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Host_IP", Host_IP, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_DataCabang", ID_DataCabang, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@ID_OperatingSystem", ID_OperatingSystem, SqlDbType.UniqueIdentifier));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Guest_Application", Guest_Application, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Guest_Processor", Guest_Processor, SqlDbType.Int));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Guest_Disk", Guest_Disk, SqlDbType.Int));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Guest_Memory", Guest_Memory, SqlDbType.Int));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Guest_Notes", Guest_Notes, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@Guest_DiskCapacity", Guest_DiskCapacity, SqlDbType.Int));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@URLAttachment", URLAttachment, SqlDbType.VarChar));
				SqlParmColl.Add(InventoryManagement.AddSqlParm("@IsDeleted", IsDeleted, SqlDbType.Bit));
				return SqlParmColl.ToArray();
			}
			catch (Exception Exc)
			{
				throw Exc;
			}
		}
		#endregion
	}
	
	public class Inventory_VMCollection : System.Collections.CollectionBase
	{
		
		[Description("Adds a new Inventory_VM to the collection.")]
		public int Add(Inventory_VM item)
		{
			int newindex = List.Add(item);
			return newindex;
		}
		
		[Description("Removes a Inventory_VM from the collection.")]
		public void Remove(Inventory_VM item)
		{
			List.Remove(item);
		}
		
		[Description("Inserts an Inventory_VM into the collection at the specified index.")]
		public void Insert(int index, Inventory_VM item)
		{
			List.Insert(index, item);
		}
		
		[Description("Returns the index value of the Inventory_VM class in the collection.")]
		public int IndexOf(Inventory_VM item)
		{
			return List.IndexOf(item);
		}
		
		[Description("Returns true if the Inventory_VM class is present in the collection.")]
		public bool Contains(Inventory_VM item)
		{
			return List.Contains(item);
		}
	}
	
	public enum Inventory_VM_Fields
	{
		
		ID,
		
		ID_SysBrand,
		
		ID_SysType,
		
		InventoryBy,
		
		InventoryDate,
		
		ID_RackNumber,
		
		ID_LabelName,
		
		Date,
		
		SystemClass,
		
		StartFrom,
		
		SystemDetail,
		
		Host_Name,
		
		Host_IP,
		
		ID_DataCabang,
		
		ID_OperatingSystem,
		
		Guest_Application,
		
		Guest_Processor,
		
		Guest_Disk,
		
		Guest_Memory,
		
		Guest_Notes,
		
		Guest_DiskCapacity,
		
		URLAttachment,
		
		IsDeleted,
	}
}
